/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mb.mbpart.object;

import net.sf.json.JSONObject;
import org.json.simple.JSONValue;

/**
 *
 * @author thanh.nguyenchi
 */
public class BranchObject {
    // define table
    public String STR_C_BRANCH_ID = "id";
    public String STR_C_NAME = "name";
    public String STR_C_ADDRESS = "address";
    public String STR_C_DESCRIPTION = "description";
    public String STR_C_LATITUDE = "latitude";
    public String STR_C_LONGITUDE = "longitude";
    public String STR_C_STATUS = "status";
    public String STR_C_FAX = "fax";
    public String STR_C_PHONE = "phone";
    public String STR_C_HOMEPAGE = "homepage";
   
    
    //public field
    public long C_BRANCH_ID;
    public String C_NAME;    
    public String C_ADDRESS;
    public String C_DESCRIPTION;
    public double C_LATITUDE;
    public double C_LONGITUDE;
    public long C_STATUS;
    public String C_FAX;   
    public String C_PHONE;  
    public String C_HOMEPAGE;      
    
    public BranchObject(){}
    
    public String toJson(){
        JSONObject objRecv = new JSONObject();
        objRecv.put(STR_C_BRANCH_ID,new Long(this.C_BRANCH_ID));
        objRecv.put(STR_C_NAME, this.C_NAME);
        objRecv.put(STR_C_ADDRESS,this.C_ADDRESS);
        objRecv.put(STR_C_LATITUDE, new Double(this.C_LATITUDE));
        objRecv.put(STR_C_LONGITUDE, new Double(this.C_LONGITUDE));   
        objRecv.put(STR_C_STATUS, new Long(this.C_STATUS)); 
        objRecv.put(STR_C_FAX, this.C_FAX);
        objRecv.put(STR_C_PHONE, this.C_PHONE);
        objRecv.put(STR_C_HOMEPAGE, this.C_HOMEPAGE);        
        return JSONValue.toJSONString(objRecv);
    }
       
}
